//
//  NetWork.h
//
//  Created by liuzhanyu on 16.3.4.
//  Copyright (c) 2016年 刘占宇. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "AFHTTPRequestOperation.h"

//BASEURL
//测试
//#define LakeYanxi_testURL @""


//http://121.40.139.205:8080/login
//
//
//http://api.meetyuu.com:9080


//老版接口
//#define LakeYanxi_FormalURL @"http://121.40.139.205:8081"

//最新接口(线上)
#define LakeYanxi_FormalURL @"http://www.meetyuu.com:9090/api"

#define BASEURL [NSURL URLWithString:LakeYanxi_FormalURL]

//获取举报分类
#define getReportCategory @"getReportCategory"

//版本更新相关
#define Init @"init"

//上传举报材料
#define uploadFile @"uploadFile"

//删除举报材料
#define deleteFile @"deleteFile"

//提交举报内容
#define rreport @"report"

//查询
#define search @"search"


@interface NetWork : NSObject<UIAlertViewDelegate>

+(void)GET:(NSString *)url parmater:(NSDictionary *)dic Block:(void (^)(NSData *data))block; // get 请求方式

+ (void)GET:(NSString *)url parmater:(NSDictionary *)dic multi:(BOOL)multi Block:(void (^)(NSData *data))block; //同一页面多个请求


+(void)POST:(NSString *)strPath parameters:(NSDictionary *)dic  finish:(void (^)(NSData *data,NSError *error) )cb;

/**
 *  发送一个get请求
 *  @param url     请求路径
 *  @param params  请求参数
 *  @param success 请求成功后的回调
 *  @param failure 请求失败后的回调
 */
+ (void)getWithURL:(NSString *)url params:(NSDictionary *)params success:(void(^)(id responseObject))success failure:(void(^)(NSError *error))failure;

+(void)typePicturePOST:(NSString *)strPath parameters:(NSDictionary *)dic withPicureData:(NSData *)pictureData  withKey:(NSString *)key finish:(void (^)(NSData *data,NSError *error) )cb;

+(void)typePictureYesPOST:(NSString *)strPath parameters:(NSDictionary *)dic withPicureData:(NSData *)pictureData  withKey:(NSString *)key finish:(void (^)(NSData *data,NSError *error) )cb;

+(void)typevideoPOST:(NSString *)strPath parameters:(NSDictionary *)dic withVideoData:(NSData *)VideoData  withKey:(NSString *)key finish:(void (^)(NSData *data,NSError *error) )cb;

+(void)typearrPicturePOST:(NSString *)strPath parameters:(NSDictionary *)dic withPicureData:(NSArray *)pictureData  withKeyArray:(NSArray *)keyArray finish:(void (^)(NSData *data,NSError *error) )cb;

- (void)downloadFileWithOption:(NSDictionary *)paramDic
                 withInferface:(NSString*)requestURL
                     savedPath:(NSString*)savedPath
               downloadSuccess:(void (^)(AFHTTPRequestOperation *operation, id responseObject))success
               downloadFailure:(void (^)(AFHTTPRequestOperation *operation, NSError *error))failure
                      progress:(void (^)(float progress))progress;

//get同步请求
//+ (void)requestsWithUrl:(NSString *)URLString params:(NSDictionary *)patams success:(void(^)(id result))block failue:(void(^)(NSError *error))failure;
//
//+ (void)requestsWithUrl:(NSString *)URLString;
@end
